#ifndef CRECORDSDIALOG_H
#define CRECORDSDIALOG_H

#include <QDialog>

namespace Ui {
class CRecordsDialog;
}

class CRecordsDialog : public QDialog
{
    Q_OBJECT

public:
    explicit CRecordsDialog(const QString &chatRoom, QWidget *parent = nullptr);
    ~CRecordsDialog();

private slots:
    void on_pushButton_clicked();

protected:
    void keyPressEvent(QKeyEvent *event) override;

private:
    void loadChatRecord();
    void addChatRecord(const QString& sender, const QString&text, const QString& time);

private:
    Ui::CRecordsDialog *ui;
    QString _chatRoom;
    unsigned int _pioneer{0};//当前的消息id
    unsigned int _notLoaded{0};
    bool _isSearch{true};
};

#endif // CRECORDSDIALOG_H
